#include "../comm.h"
class Solution {
public:
    // 利用滑动唇口进行求解
    using LL = long long;
    long long minimumSteps(string s) {
        LL ans = 0;
        for(int i = -1, j = 0; j < s.size(); ++j)
        {
            char ch = s[j];
            if(ch == '1') continue;
            // 遇到一个白球，就要直接往前推
            ans += j - (++i);
        }
        return ans;
    }
};